<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<p:outputPanel id="panelSociedad">
	   	<p:panelGrid>
	   		<f:facet name="header">
	    		<p:row>
	    			<p:column colspan="2">
	    				<h:outputText id="currentUO" value="#{definirConstantesMB.selectedNode}" />
	    			</p:column>
	    		</p:row>
	   		</f:facet>
			<p:row>
	       		<p:column><h:outputText value = "#{msg['message.padPP.labelSociedad']}"/></p:column>
	       		<p:column>
	       			<p:selectOneMenu id="sociedad" value="#{definirConstantesMB.sociedad}">
						<f:selectItems value="#{definirConstantesMB.sociedades}" var="soc"
							itemValue="#{soc.sociedad}" itemLabel="#{soc.sociedadDescripcion}" />
						 <p:ajax process="@this"
						 	update="panelCaptura panelMsg panelSociedad"
						 	listener="#{definirConstantesMB.processChangeSociedad}" />
					</p:selectOneMenu>
	       		</p:column>
	   		</p:row>
	   		<p:row rendered="#{definirConstantesMB.panelCapturaShow}">
	       		<p:column><h:outputText value = "#{msg['message.padPP.labelPermitirCaptura']}"/></p:column>
	       		<p:column>
	       			<p:selectBooleanButton id="permiteCaptura" value="#{definirConstantesMB.permiteCaptura}"
	       				onLabel="#{msg['message.padPP.labelYes']}" offLabel="#{msg['message.padPP.labelNo']}"
	       				onIcon="ui-icon-check" offIcon="ui-icon-close" />
	       		</p:column>
	   		</p:row>
	   		<p:row rendered="#{definirConstantesMB.panelCapturaShow}">
	       		<p:column><h:outputText value = "#{msg['message.padPP.labelPermitirCapturaCascada']}"/></p:column>
	       		<p:column>
	       			<p:selectBooleanButton id="habilitaCapturaCascada" value="#{definirConstantesMB.habilitaCapturaCascada}"
	       				onLabel="#{msg['message.padPP.labelYes']}" offLabel="#{msg['message.padPP.labelNo']}"
	       				onIcon="ui-icon-check" offIcon="ui-icon-close" />
	       		</p:column>
	   		</p:row>
		</p:panelGrid>
	</p:outputPanel>
	<p:outputPanel id="panelMsg">
		<p:panelGrid rendered="#{definirConstantesMB.panelMsgShow}">
			<f:facet name="header">
				<p:row>
					<p:column>
						<h:outputFormat value = "#{msg['message.padPP.labelNoDefBudgetPadre']}">
							<f:param value="#{definirConstantesMB.selectedNode.parent.data.unidadOrganizativaDescripcion}"/>
							<f:param value="#{definirConstantesMB.sociedad}"/>
						</h:outputFormat>
					</p:column>
				</p:row>
			</f:facet>
		</p:panelGrid>
	</p:outputPanel>
	<p:outputPanel id="panelCaptura">
		<p:panelGrid rendered="#{definirConstantesMB.panelCapturaShow}">
			<f:facet name="header">
				<p:row>
					<p:column colspan = "14"><h:outputText value = "#{definirConstantesMB.capturaEjercicio.anioCaptura}"/></p:column>
				</p:row>
			</f:facet>
			<f:facet name="header">
				<p:row>
					<p:column></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth01']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth02']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth03']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth04']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth05']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth06']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth07']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth08']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth09']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth10']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth11']}"/></p:column>
					<p:column><h:outputText value = "#{msg['message.padPP.labelMonth12']}"/></p:column>
					<p:column>Total</p:column>
				</p:row>
			</f:facet>
			<p:row>
				<p:column><h:outputText value = "#{msg['message.padPP.labelTope']}"/></p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoEnero}">
						<f:convertNumber currencySymbol="$" type="currency"
						groupingUsed="true" maxFractionDigits="2"/>
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoFebrero}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoMarzo}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoAbril}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoMayo}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoJunio}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoJulio}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoAgosto}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoSeptiembre}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoOctubre}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>				   					
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoNoviembre}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoDiciembre}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>
					</h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{definirConstantesMB.montosTope.montoTotal}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>
					</h:outputText>
				</p:column>
			</p:row>
			<p:row>
				<p:column><h:outputText value = "#{msg['message.padPP.labelBudget']}"/></p:column>
				<p:column>
					<p:inputText id="Enero" size="10" value="#{definirConstantesMB.montosBudget.montoEnero}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth01']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth01']}">
							<f:ajax event="keyup" render="totalBudget"/>
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoEnero == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoEnero != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoEnero}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Febrero" size="10" value="#{definirConstantesMB.montosBudget.montoFebrero}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth02']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth02']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoFebrero == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoFebrero != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoFebrero}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Marzo" size="10" value="#{definirConstantesMB.montosBudget.montoMarzo}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth03']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth03']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoMarzo == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoMarzo != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoMarzo}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Abril" size="10" value="#{definirConstantesMB.montosBudget.montoAbril}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth04']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth04']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoAbril == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoAbril != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoAbril}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Mayo" size="10" value="#{definirConstantesMB.montosBudget.montoMayo}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth05']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth05']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoMayo == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoMayo != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoMayo}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Junio" size="10" value="#{definirConstantesMB.montosBudget.montoJunio}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth06']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth06']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoJunio == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoJunio != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoJunio}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Julio" size="10" value="#{definirConstantesMB.montosBudget.montoJulio}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth07']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth07']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoJulio == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoJulio != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoJulio}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Agosto" size="10" value="#{definirConstantesMB.montosBudget.montoAgosto}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth08']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth08']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoAgosto == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoAgosto != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoAgosto}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Septiembre" size="10" value="#{definirConstantesMB.montosBudget.montoSeptiembre}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth09']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth09']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoSeptiembre == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoSeptiembre != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoSeptiembre}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Octubre" size="10" value="#{definirConstantesMB.montosBudget.montoOctubre}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth10']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth10']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoOctubre == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoOctubre != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoOctubre}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Noviembre" size="10" value="#{definirConstantesMB.montosBudget.montoNoviembre}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth11']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth11']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoNoviembre == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoNoviembre != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoNoviembre}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<p:inputText id="Diciembre" size="10" value="#{definirConstantesMB.montosBudget.montoDiciembre}"
						converterMessage="#{msg['message.padPP.labelConvertionError']} #{msg['message.padPP.labelMonth12']}"
						validatorMessage="#{msg['message.padPP.labelValidationBudgetError']} #{msg['message.padPP.labelMonth12']}">
							<f:ajax event="keyup" render="totalBudget" />
							<f:convertNumber type="number" groupingUsed="false" minFractionDigits="2"/>
							<c:if test="#{definirConstantesMB.montosTope.montoDiciembre == null}">
								<f:validateDoubleRange minimum="0" />
							</c:if>
							<c:if test="#{definirConstantesMB.montosTope.montoDiciembre != null}">
								<f:validateDoubleRange minimum="0" maximum="#{definirConstantesMB.montosTope.montoDiciembre}" />
							</c:if>
					</p:inputText>
				</p:column>
				<p:column>
					<h:outputText id = "totalBudget" value="#{definirConstantesMB.montosBudget.montoTotal}">
						<f:convertNumber currencySymbol="$" type="currency"
							groupingUsed="true" maxFractionDigits="2"/>
					</h:outputText>
				</p:column>
			</p:row>
			<p:row>
				<p:column colspan="10"><p:messages id="messages" showSummary="false" showDetail="true" autoUpdate="true"  closable="true"/></p:column>
			</p:row>
			<p:row>
				<p:column colspan = "14">
					<p:commandButton id="btnSave" value="#{msg['message.padPP.labelBtnSaveChanges']}"
						 icon="ui-icon-disk"
						actionListener="#{definirConstantesMB.saveChanges}"/>
				</p:column>
			</p:row>
		</p:panelGrid>
	</p:outputPanel>
</ui:composition>